using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._NetworkAnalystTools._Analysis
{
    /// <summary>
    /// <para>Add Vehicle Routing Problem Breaks</para>
    /// <para>Creates breaks in a Vehicle Routing Problem (VRP) layer.</para>
    /// <para>在车辆配送问题 （VRP） 图层中创建中断。</para>
    /// </summary>    
    [DisplayName("Add Vehicle Routing Problem Breaks")]
    public class AddVehicleRoutingProblemBreaks : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddVehicleRoutingProblemBreaks()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_vrp_layer">
        /// <para>Input Vehicle Routing Problem Layer</para>
        /// <para>The vehicle routing problem analysis layer to which the breaks will be added.</para>
        /// <para>将添加中断的车辆路径问题分析图层。</para>
        /// </param>
        public AddVehicleRoutingProblemBreaks(object _in_vrp_layer)
        {
            this._in_vrp_layer = _in_vrp_layer;
        }
        public override string ToolboxName => "Network Analyst Tools";

        public override string ToolName => "Add Vehicle Routing Problem Breaks";

        public override string CallName => "na.AddVehicleRoutingProblemBreaks";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_vrp_layer, _target_route, _break_type.GetGPValue(), _time_window_properties, _travel_time_properties, _work_time_properties, _append_to_existing_breaks.GetGPValue(), _out_vrp_layer];

        /// <summary>
        /// <para>Input Vehicle Routing Problem Layer</para>
        /// <para>The vehicle routing problem analysis layer to which the breaks will be added.</para>
        /// <para>将添加中断的车辆路径问题分析图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Vehicle Routing Problem Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_vrp_layer { get; set; }


        /// <summary>
        /// <para>Target Route Name</para>
        /// <para>The route for the break parameters.  If this parameter is not specified, breaks are created for each existing route.</para>
        /// <para>中断参数的路径。 如果未指定此参数，则会为每个现有路由创建中断。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Route Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _target_route { get; set; } = null;


        /// <summary>
        /// <para>Break Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of breaks for the current VRP layer. All breaks must be of the same type.</para>
        ///   <bulletList>
        ///     <bullet_item>Time Window Break— Breaks take place during a specific time window. This is the default.</bullet_item><para/>
        ///     <bullet_item>Maximum Travel Time Break— Breaks are taken after a certain amount of travel time. These values are given as the amount of time either until the first break or between breaks.</bullet_item><para/>
        ///     <bullet_item>Maximum Work Time Break— Breaks are taken after a certain amount of cumulative time. These values are always an amount of elapsed time since the start of the route.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定当前 VRP 图层的中断类型。所有中断必须属于同一类型。</para>
        ///   <bulletList>
        ///     <bullet_item>时间窗口中断 — 中断发生在特定时间窗口内。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>最大旅行时间休息时间— 在一定旅行时间后进行休息。这些值以第一次中断之前或中断之间的时间量的形式给出。</bullet_item><para/>
        ///     <bullet_item>最大工作时间休息时间— 在一定累积时间后进行休息。这些值始终是自路线开始以来经过的时间量。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Break Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _break_type_value _break_type { get; set; } = _break_type_value._TIME_WINDOW_BREAK;

        public enum _break_type_value
        {
            /// <summary>
            /// <para>Time Window Break</para>
            /// <para>Time Window Break— Breaks take place during a specific time window. This is the default.</para>
            /// <para>时间窗口中断 — 中断发生在特定时间窗口内。这是默认设置。</para>
            /// </summary>
            [Description("Time Window Break")]
            [GPEnumValue("TIME_WINDOW_BREAK")]
            _TIME_WINDOW_BREAK,

            /// <summary>
            /// <para>Maximum Travel Time Break</para>
            /// <para>Maximum Travel Time Break— Breaks are taken after a certain amount of travel time. These values are given as the amount of time either until the first break or between breaks.</para>
            /// <para>最大旅行时间休息时间— 在一定旅行时间后进行休息。这些值以第一次中断之前或中断之间的时间量的形式给出。</para>
            /// </summary>
            [Description("Maximum Travel Time Break")]
            [GPEnumValue("MAXIMUM_TRAVEL_TIME_BREAK")]
            _MAXIMUM_TRAVEL_TIME_BREAK,

            /// <summary>
            /// <para>Maximum Work Time Break</para>
            /// <para>Maximum Work Time Break— Breaks are taken after a certain amount of cumulative time. These values are always an amount of elapsed time since the start of the route.</para>
            /// <para>最大工作时间休息时间— 在一定累积时间后进行休息。这些值始终是自路线开始以来经过的时间量。</para>
            /// </summary>
            [Description("Maximum Work Time Break")]
            [GPEnumValue("MAXIMUM_WORK_TIME_BREAK")]
            _MAXIMUM_WORK_TIME_BREAK,

        }

        /// <summary>
        /// <para>Break Properties</para>
        /// <para><xdoc>
        ///   <para>Specifies a time range within which the break will begin. To set up a time window break, use two time-of-day values.</para>
        ///   <para>The options below are enabled when the Break Type parameter is set to Time Window Break.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Is Paid—A Boolean value indicating whether the break is paid.</bullet_item><para/>
        ///       <bullet_item>Break Duration—The duration of the break. This field can't contain null values and has a default value of 60.</bullet_item><para/>
        ///       <bullet_item>Time Window Start—The start time of the time window.</bullet_item><para/>
        ///       <bullet_item>Time Window End—The end time of the time window.</bullet_item><para/>
        ///       <bullet_item>Maximum Violation Time—The maximum allowable violation time for a time window break. A time window is considered violated if the arrival time falls outside the time range. A zero value indicates that the time window cannot be violated, that is, the time window is hard. A nonzero value indicates the maximum delay time. For example, the break can begin up to 30 minutes beyond the end of its time window but the delay is penalized pursuant to the Time Window Violation Importance setting, which rates the importance of honoring time windows without causing violations.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定中断开始的时间范围。若要设置时间范围中断，请使用两个时间值。</para>
        ///   <para>当“中断类型”参数设置为“时间窗口中断”时，将启用以下选项。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>已付款 - 指示中断是否已支付的布尔值。</bullet_item><para/>
        ///       <bullet_item>中断持续时间 - 中断的持续时间。此字段不能包含 null 值，默认值为 60。</bullet_item><para/>
        ///       <bullet_item>时间窗口开始 （Time Window Start） - 时间窗口的开始时间。</bullet_item><para/>
        ///       <bullet_item>时间窗口结束 - 时间窗口的结束时间。</bullet_item><para/>
        ///       <bullet_item>最大违规时间 - 时间窗口中断允许的最大违规时间。如果到达时间超出时间范围，则视为违反时间窗口。零值表示不能违反时间窗口，即时间窗口是硬的。非零值表示最大延迟时间。例如，中断可以在其时间窗口结束后最多 30 分钟后开始，但延迟会根据“时间窗口违规重要性”设置进行处罚，该设置评估在不造成违规的情况下遵守时间窗口的重要性。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Break Properties")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_window_properties { get; set; } = null;


        /// <summary>
        /// <para>Break Properties</para>
        /// <para><xdoc>
        ///   <para>Specifies how long a person can drive before the break is required.</para>
        ///   <para>The properties below are enabled when the Break Type parameter is set to Maximum Travel Time Break.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Is Paid—A Boolean value indicating whether the break is paid.</bullet_item><para/>
        ///       <bullet_item>Break Duration—The duration of the break. This field can't contain null values and has a default value of 60.</bullet_item><para/>
        ///       <bullet_item>Maximum Travel Time Between Breaks—The maximum amount of travel time that can be accumulated before the break is taken. The travel time is accumulated either from the end of the previous break or, if a break has not yet been taken, from the start of the route.
        ///       <para>If this is the route's final break, The MaxTravelTimeBetweenBreaks field also indicates the maximum travel time that can be accumulated from the final break to the end depot.</para>
        ///       <para>This field limits how long a person can drive until a break is required. For example, if the Time Field Units parameter (time_units in Python) of the analysis is set to Minutes, and the MaxTravelTimeBetweenBreaks field has a value of 120, the driver will get a break after two hours of driving. To assign a second break after two additional hours of driving, the second break's MaxTravelTimeBetweenBreaks field value must be 120.</para>
        ///       <para>The unit for this field value is specified by the Time Field Units parameter (time_units in Python).</para>
        ///       </bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定一个人在需要休息之前可以行驶多长时间。</para>
        ///   <para>当“中断类型”参数设置为“最大行驶时间中断”时，将启用以下属性。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>已付款 - 指示中断是否已支付的布尔值。</bullet_item><para/>
        ///       <bullet_item>中断持续时间 - 中断的持续时间。此字段不能包含 null 值，默认值为 60。</bullet_item><para/>
        /// <bullet_item>中断之间的最大行程时间 - 在休息之前可以累积的最大行程时间。旅行时间从上一次休息结束开始累积，或者，如果尚未休息，则从路线开始累积。
        ///       <para>如果这是路线的最终停靠点，则 MaxTravelTimeBetweenBreaks 字段还指示从最终停靠点到终点车辆段可以累积的最大行驶时间。</para>
        ///       <para>此字段限制一个人在需要休息之前可以行驶多长时间。例如，如果分析的时间字段单位参数（在 Python 中为 time_units）设置为“分钟”，并且 MaxTravelTimeBetweenBreaks 字段的值为 120，则驾驶员将在驾驶两小时后休息。若要在额外行驶两个小时后分配第二个休息时间，第二个休息时间的 MaxTravelTimeBetweenBreaks 字段值必须为 120。</para>
        ///       <para>此字段值的单位由时间字段单位参数（在 Python 中为 time_units）指定。</para>
        ///       </bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Break Properties")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _travel_time_properties { get; set; } = null;


        /// <summary>
        /// <para>Break Properties</para>
        /// <para><xdoc>
        ///   <para>Specifies how long a person can work before a break is required.</para>
        ///   <para>The properties below are enabled when the Break Type parameter is set to Maximum Work Time Break.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Is Paid—A Boolean value indicating whether the break is paid.</bullet_item><para/>
        ///       <bullet_item>Break Duration—The duration of the break. This field can't contain null values and has a default value of 60.</bullet_item><para/>
        ///       <bullet_item>Maximum Cumulative Work Time—The maximum amount of work time that can be accumulated before the break is taken. Work time is always accumulated from the beginning of the route. Work time is the sum of travel time and service times at orders, depots, and breaks. However, this excludes wait time, which is the time a route (or driver) spends waiting at an order or depot for a time window to begin.
        ///       <para>The MaxCumulWorkTime field also indicates the maximum amount of work time that can be accumulated before the break is taken.</para>
        ///       <para>This field limits how long a person can work until a break is required. For example, if the Time Field Units parameter (time_units in Python) is set to Minutes, the MaxCumulWorkTime field has a value of 120, and the ServiceTime field has a value of 15, the driver will get a 15-minute break after 2 hours of work.</para>
        ///       <para>Continuing with this example, assume a second break is needed after 3 additional hours of work. To specify this break, you would enter 315 (5 hours and 15 minutes) as the second break's MaxCumulWorkTime field value. This number includes the MaxCumulWorkTime and ServiceTime field values of the preceding break, along with the 3 additional hours of work time before granting the second break. To avoid taking maximum work time breaks prematurely, remember that work time is accumulated from the beginning of the route and it includes the service time at previously visited depots, orders, and breaks.</para>
        ///       </bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定一个人在需要休息之前可以工作多长时间。</para>
        ///   <para>当“中断类型”参数设置为“最大工作时间中断”时，将启用以下属性。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>已付款 - 指示中断是否已支付的布尔值。</bullet_item><para/>
        ///       <bullet_item>中断持续时间 - 中断的持续时间。此字段不能包含 null 值，默认值为 60。</bullet_item><para/>
        /// <bullet_item>最大累计工作时间 - 在休息之前可以累积的最大工作时间。工作时间总是从路线的起点开始累积的。工作时间是订单、仓库和休息处的旅行时间和服务时间的总和。但是，这不包括等待时间，等待时间是路线（或司机）在订单或仓库等待时间窗口开始的时间。
        ///       <para>MaxCumulWorkTime 字段还指示在休息之前可以累积的最大工作时间。</para>
        ///       <para>此字段限制一个人在需要休息之前可以工作多长时间。例如，如果时间字段单位参数（Python 中的time_units）设置为“分钟”，则 MaxCumulWorkTime 字段的值为 120，ServiceTime 字段的值为 15，则驱动程序将在 2 小时工作后获得 15 分钟的休息时间。</para>
        ///       <para>继续这个例子，假设在额外工作 3 小时后需要第二次休息。若要指定此中断，请输入 315（5 小时 15 分钟）作为第二个中断的 MaxCumulWorkTime 字段值。此数字包括前一个中断的 MaxCumulWorkTime 和 ServiceTime 字段值，以及在授予第二个中断之前额外 3 小时的工作时间。为避免过早地获得最大工作时间休息时间，请记住，工作时间是从路线起点开始累积的，它包括以前访问过的仓库、订单和休息时间的服务时间。</para>
        ///       </bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Break Properties")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _work_time_properties { get; set; } = null;


        /// <summary>
        /// <para>Append To Existing Breaks</para>
        /// <para><xdoc>
        ///   <para>Specifies whether new breaks will be appended to the existing breaks attribute table. 
        ///   <bulletList>
        ///     <bullet_item>Checked—New breaks will be appended to the existing set in the breaks attribute table. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Existing breaks will be replaced with new breaks.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否将新中断追加到现有中断属性表中。
        ///   <bulletList>
        ///     <bullet_item>选中—新中断将追加到中断属性表中的现有集。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 现有中断将替换为新中断。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Append To Existing Breaks")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _append_to_existing_breaks_value _append_to_existing_breaks { get; set; } = _append_to_existing_breaks_value._true;

        public enum _append_to_existing_breaks_value
        {
            /// <summary>
            /// <para>APPEND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("APPEND")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>CLEAR</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CLEAR")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Vehicle Routing Problem Layer</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Vehicle Routing Problem Layer")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_vrp_layer { get; set; }


        public AddVehicleRoutingProblemBreaks SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}